import request from '@/utils/request'
import { ChangeInfoRequest,ChangePasswordRequest,ChangeResponse,InfoResponse,UploadAvatarRequest,UploadAvatarResponse } from '@/types/my'
// 退出登录
export async function logout() {
  const response = await request.post<any>('/wx/user/logout', {})
  return response.data
}

export async function getInfo(){
  const response = await request.get<InfoResponse>('/wx/user/getMyInfo')
  return response.data
}

//修改信息
export async function updateInfo(requestData:ChangeInfoRequest){
  const response =await request.post<ChangeResponse>('/wx/user/editMyInfo',requestData)
  return response.data
}

//修改密码
export async function updatePassword(requestData:ChangePasswordRequest){
  const response =await request.post<ChangeResponse>('/wx/user/editMyPassword',requestData)
  return response
}

export async function uploadAvatar(requestData:UploadAvatarRequest){
  const response =await request.post<UploadAvatarResponse>('/all/uploadPicture',requestData)
  return response
}